# coding:utf-8
import yaml
import os
from com.power.auto.test.utils.path_utils import *

root = get_client_config_path()
print(root)

yamlPath = os.path.join(root, "env.yml")
f=open(yamlPath,'r',encoding= 'utf-8')
cfg = f.read()
print(type(cfg))  # 读出来是字符串
print(cfg)
d = yaml.load(cfg)  # 用load方法转字典
print(d['env'])



hessianPath = os.path.join(root, "hessian-%s.yml" % d['env'])
hessianFile=open(hessianPath,'r',encoding= 'utf-8')
hessianCfg = hessianFile.read()
print(type(hessianCfg))  # 读出来是字符串
print(hessianCfg)
hessianCfgD = yaml.load(hessianCfg)  # 用load方法转字典
print(hessianCfgD['base-url']+hessianCfgD['pay']['url-suf'])